testCarnumber = function (str) {
  var a = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
  if (a.test(str || '')) {
    return true;
  } else {
    return false;
  }
}

//去除两边空格
var trim = function(str) {
  return str.replace(/(^\s*)|(\s*$)/g, ""); 
};
